home *** CD-ROM | disk | FTP | other *** search
- #
- # setfuncs.test
- #
- # Tests for tcl.tlib set functions.
- #---------------------------------------------------------------------------
- # Copyright 1992 Karl Lehenbauer and Mark Diekhans.
- #
- # Permission to use, copy, modify, and distribute this software and its
- # documentation for any purpose and without fee is hereby granted, provided
- # that the above copyright notice appear in all copies. Karl Lehenbauer and
- # Mark Diekhans make no representations about the suitability of this
- # software for any purpose. It is provided "as is" without express or
- # implied warranty.
- #------------------------------------------------------------------------------
- # $Id: setfuncs.test,v 2.0 1992/10/16 04:50:14 markd Rel $
- #------------------------------------------------------------------------------
- #
-
- if {[info procs test] == ""} then {source testlib.tcl}
-
- rename SAVED_UNKNOWN unknown
-
- test setfuncs-1.1 {union command} {
- union "" ""
- } ""
-
- test setfuncs-1.2 {union command} {
- union a ""
- } "a"
-
- test setfuncs-1.3 {union command} {
- union "a b" "b c"
- } "a b c"
-
- test setfuncs-1.4 {union command} {
- union "a b c d" "a b c d"
- } "a b c d"
-
- test setfuncs-1.5 {union command} {
- union "a d c d b" "b d c a a b d a b c d"
- } "a b c d"
-
- test setfuncs-1.6 {union command} {
- union "d c b a e f" ""
- } "a b c d e f"
-
- test setfuncs-1.7 {union command} {
- union "" "f e d c b a"
- } "a b c d e f"
-
- test setfuncs-1.8 {union command} {
- union "{n p}" "f e d c b a"
- } "a b c d e f {n p}"
-
- test setfuncs-1.9 {union command} {
- union "{n p}" "f e d c {n p} b a"
- } "a b c d e f {n p}"
-
- test setfuncs-1.10 {union command} {
- union "{n p} z {n p} z" "f e d c {n p} b a"
- } "a b c d e f {n p} z"
-
-
- test setfuncs-2.1 {intersect command} {
- intersect "" ""
- } ""
-
- test setfuncs-2.2 {intersect command} {
- intersect "a b c" ""
- } ""
-
- test setfuncs-2.3 {intersect command} {
- intersect "" "a b c"
- } ""
-
- test setfuncs-2.4 {intersect command} {
- intersect "d f b" "a b c"
- } "b"
-
- test setfuncs-2.5 {intersect command} {
- intersect "a p q d v m b n o z t d f b" "a b c"
- } "a b"
-
- test setfuncs-2.6 {intersect command} {
- intersect "d c b a e f" "{n p}"
- } ""
-
- test setfuncs-2.7 {intersect command} {
- intersect "d c" "f e d c b a"
- } "c d"
-
- test setfuncs-2.8 {intersect command} {
- intersect "a f {n p} e" "f e d c b a"
- } "a e f"
-
- test setfuncs-2.9 {intersect command} {
- intersect "{n p} f d" "f e d c {n p} b a"
- } "d f {n p}"
-
- test setfuncs-2.10 {intersect command} {
- intersect "{n p} z {n p} z" "f e d c {n p} b a"
- } "{n p}"
-
- test setfuncs-3.1 {intersect3 command} {
- intersect3 "" ""
- } "{} {} {}"
-
- test setfuncs-3.2 {intersect3 command} {
- intersect3 "a b c" ""
- } "{a b c} {} {}"
-
- test setfuncs-3.3 {intersect3 command} {
- intersect3 "" "a b c"
- } "{} {} {a b c}"
-
- test setfuncs-3.4 {intersect3 command} {
- intersect3 "d f b" "a b c"
- } "{d f} b {a c}"
-
- test setfuncs-3.5 {intersect3 command} {
- intersect3 "a p q d v m b n o z t d f b" "a b c"
- } "{d f m n o p q t v z} {a b} c"
-
- test setfuncs-4.1 {lrmdups command} {
- lrmdups {a d b c eee b d 1}
- } {1 a b c d eee}
-
- test setfuncs-4.2 {lrmdups command} {
- lrmdups {aaa aaa aaaa aaa aaa }
- } {aaa aaaa}
-
- test setfuncs-4.3 {lrmdups command} {
- lrmdups {{} aaa {} aaa aaa }
- } {{} aaa}
-
- test setfuncs-4.4 {lrmdups command} {
- lrmdups {aaa}
- } {aaa}
-
- rename unknown SAVED_UNKNOWN
-
-